<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/homemaking/homemakingOrder.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'north',border:false,split:false">
	    	<form id="query-form" class="search_form clearfix">
	            <dl>
					<dt>订单号：</dt>
					<dd>
						<input name="orderNo" id="orderNo" type="text" class="txt" maxlength="64"/>
					</dd>
				</dl>
	            <p class="search_form_btn">
	            	<input type="button" value="搜索" class="icon_serach" onclick="admin.homemakingOrder.query()" />
	            </p>
	        </form>
	  	</div>
	    <div data-options="region:'center',border:false">
		    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/homemaking/order/list?baseId=${baseId }',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'orderNo',width:250,align:'center'">订单号</th>
						<th data-options="field:'strNewAt',width:150,align:'center'">下单时间</th>
						<th data-options="field:'status',width:100,align:'center',formatter:formatStatus ">服务状态</th>
						<th data-options="field:'buyerNick',width:80,align:'center' ">预约人</th>
						<th data-options="field:'serviceDateStr',width:100,align:'center' ">服务日期</th>
						<th data-options="field:'serviceHourStr',width:100,align:'center'">服务时间</th>
			            <th data-options="field:'id',align:'center',width:150,formatter:formatOperation ">操作</th>
					</tr>
				</thead>
			</table>
	  	</div>
	</div>

	<script>
	function formatStatus(value,row,index) {
		var l_html = '';
		if (value == 1) {
			l_html = '等待服务';
		} else if (value == 2) {
			l_html = '已服务';
		} else {
			l_html = '已取消';
		}
		return l_html;
	}
		function formatOperation(value,row,index) {
			var l_html = '';
			l_html += '<a href="javascript:;" class="table_link" onclick="admin.homemakingOrder.detail('+row.id+')">查看详情</a>';
			return l_html;
		}
	</script>
  </body>
</html>
